package com.atguigu.designpattern;


import com.atguigu.designpattern.strategy.SortContext;
import com.atguigu.designpattern.strategy.impl.SortStrategyEnum;

/**
 * @author lfy
 * @create 2022-12-28 21:17
 * @description  模板模式定义大框架、策略默认定义小细节
 */
public class StrategyPatternTest {

    public static void main(String[] args) {
        Integer[] arr = new Integer[]{2,4,6,3,1,7,9,8};
        SortContext sortContext = new SortContext();
        sortContext.sort(arr, SortStrategyEnum.BUBBLE_SORT.getCode());

        System.out.println("===============");

        sortContext.sort(arr,SortStrategyEnum.QUICK_SORT.getCode());

    }
}
